package org.linlinjava.litemall.admin.web;

import org.linlinjava.litemall.admin.service.AdminMemberOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/admin/memberOrder")
public class AdminMemberOrderController {
    @Autowired
    private AdminMemberOrderService adminMemberOrderService;

    /**
     * 后台退押金
     *
     * @param memberOrderId
     * @return
     */
    @PostMapping("/doRefund")
    public Object doRefund(@RequestBody Integer memberOrderId) {
        return adminMemberOrderService.doRefund(memberOrderId);
    }


    @PostMapping("/doOfflineRefund")
    public Object doOfflineRefund(@RequestBody Integer memberOrderId) {
        return adminMemberOrderService.doOfflineRefund(memberOrderId);
    }

    /**
     * 申请退押金订单list
     *
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/listRefundingDeposit")
    public Object listRefundingDeposit(
            @RequestParam(required = false, defaultValue = "1") Integer page,
            @RequestParam(required = false, defaultValue = "10") Integer limit,
            @RequestParam(required = false) String nickname,
            @RequestParam(required = false) String status
            ) {
        return adminMemberOrderService.listRefundingDeposit(page, limit,nickname,status);
    }

}
